Skip to content

feat(refund-vault): add oracle aggregator + median-based dynamic refund policy engine - #262

Merged
mallison031 merged 3 commits into
accensa:mainfrom
adelekevictor12:feat/oracle-aggregator-refund-vault
Aug 30, 2026
Merged

feat(refund-vault): add oracle aggregator + median-based dynamic refund policy engine#262
mallison031 merged 3 commits into
accensa:mainfrom
adelekevictor12:feat/oracle-aggregator-refund-vault

Conversation

@adelekevictor12

Copy link
Copy Markdown
Contributor

Closes #133

…nd policy engine

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@adelekevictor12 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mergekeeper

mergekeeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #133.
Verdict: clean

The PR successfully implements the oracle aggregator, standard oracle interface, and median-based dynamic refund policy engine with thorough test coverage and security considerations.

Reviewed commit: 988c658ae516aed215472ae3ec811258831d10b4.
CI and merge eligibility are checked separately.

mergekeeper[bot]
mergekeeper Bot previously approved these changes Aug 28, 2026

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Successfully designed and integrated the decentralized oracle aggregator and dynamic refund policy engine with comprehensive test coverage.

@mergekeeper

mergekeeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

MergeKeeper merge status

Status: blocked
PR state: open
Mergeability: unknown
Checked commit: 988c658ae516aed215472ae3ec811258831d10b4.

Reason: One or more required CI checks failed.

Failing checks:

Next steps:

  1. Open the failing check details above and fix the reported error.
  2. Run the same checks locally where possible.
  3. Commit and push the fix.
  4. MergeKeeper will automatically re-review the updated PR.

@adelekevictor12

Copy link
Copy Markdown
Contributor Author

done

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

Needs changes

The refund logic refactor in lib.rs introduces syntax errors and disrupted control flow around ceiling checks and event publication.

  • contracts/refund-vault/src/lib.rs:829: Malformed code block in refund_internal: .publish(env); is called as a method on a closing brace rather than on an event struct instance, and release_reentrancy_lock(env) is called with an argument instead of release_reentrancy_lock(&env).
  • contracts/refund-vault/src/lib.rs:816: The ceiling check and update logic was truncated/displaced during refactoring, leading to potential type errors and incorrect verification order.

Reviewed commit: 8eedcdc1413a406cec2b8bf798fcdc8ac33648d0.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes

The refund logic refactor in lib.rs introduces syntax errors and disrupted control flow around ceiling checks and event publication.

  • contracts/refund-vault/src/lib.rs:829: Malformed code block in refund_internal: .publish(env); is called as a method on a closing brace rather than on an event struct instance, and release_reentrancy_lock(env) is called with an argument instead of release_reentrancy_lock(&env).
  • contracts/refund-vault/src/lib.rs:816: The ceiling check and update logic was truncated/displaced during refactoring, leading to potential type errors and incorrect verification order.

Reviewed commit: 8eedcdc1413a406cec2b8bf798fcdc8ac33648d0.

@mallison031
mallison031 merged commit fd2f05f into accensa:main Aug 30, 2026
2 of 6 checks passed
wagmiiii pushed a commit that referenced this pull request Aug 30, 2026
…in roles

Adds a new `governance` contract that closes the single-admin-key SPOF on
ReceiptAnchor's merchant role: a fixed set of weighted members propose a
call, vote on it over a bounded window, and once "yes" weight clears a
configured quorum and outweighs "no", anyone can execute it. No change to
the governed contract is needed — the host's own self-authorization rule
(a contract's require_auth() on its own address auto-succeeds when it is
the direct caller) carries the authority through when Governance calls
into ReceiptAnchor's existing merchant-gated functions, the same mechanism
already used for a MultisigAccount admin.

ReceiptAnchor has no upgrade entry point, and docs/ADR-003-upgradeability.md
(accepted) forbids adding one without reopening that ADR, so this wrapper
gates only the admin surface that actually exists today
(set_min_anchor_interval, anchor_batch, prune_batches) rather than
introducing upgrade authority.

Storage is kept small on purpose: each member's weight is its own
persistent entry, per-voter "already voted" markers live in temporary
storage so they expire with the voting window on their own, and a
resolved proposal's calldata can be reclaimed immediately via
prune_proposal instead of waiting on archival.

Also fixes two pre-existing, unrelated build breaks discovered while
wiring up governance's own tests, both required just to get `cargo build`
/ `cargo test` working across the workspace again:
- receipt-anchor and refund-vault Cargo.toml declared their optional
  `budget_macros` dependency under [dev-dependencies], which Cargo
  disallows (optional dev-dependencies are not permitted); moved it to
  [dependencies], still gated by the `budget-assert` feature and only
  referenced from a #[cfg(test)] module, so it never links into a real
  build.
- receipt-anchor's test_shared_vectors_cover_required_edge_cases used the
  bare `Vec` identifier, which resolves to soroban_sdk::Vec (imported at
  the top of the file) instead of std's Vec, and doesn't implement
  FromIterator<&str>; qualified it as std::vec::Vec explicitly.

Note: contracts/refund-vault/src/lib.rs has a separate, still-unfixed
issue — add_oracle (added in #262) is missing its body/closing brace and
currently fails to compile at all. Left alone here since it's unrelated
to this change and its intended whitelist-insertion logic isn't specified
anywhere I could find.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design and Integrate a Decentralized Oracle for Dynamic Refund Policies

2 participants